from ConfigParser import ConfigParser


# -----------------------------------------------------------------------------
# This is the one place you have to tell the ATS something about your
# local setup.   
# -----------------------------------------------------------------------------
# CONF_BASE is where your alttechstack/conf directory lives 
# e.g.: CONF_BASE = '/opt/apache/alttechstack/conf'
CONF_BASE = '/opt/apache/alttechstack/conf'
# Name your config file and urlmap file. 
# e.g.: CONF_FILE = CONF_BASE + "/" + "alttechstack.conf" 
CONF_FILE = CONF_BASE + "/" + "alttechstack.conf" 
# e.g.: URL_FILE  = CONF_BASE + "/" + "urlmap.conf"
URL_FILE  = CONF_BASE + "/" + "urlmap.conf"

# -----------------------------------------------------------------------------
# Globals
# -----------------------------------------------------------------------------
base = ConfigParser()
urls = ConfigParser()

# -----------------------------------------------------------------------------
# Config wrappers
# -----------------------------------------------------------------------------
def get_config():
	""" parse the conf file and return results 
	"""
	fp = open(CONF_FILE, 'r')
	base.readfp(fp)
	fp.close()
	return base 

# -----------------------------------------------------------------------------
def get_urlmap_conf():
	""" parse the urlmap conf file and return results
	"""
	fp = open(URL_FILE, 'r')
	urls.readfp(fp)
	fp.close()
	return urls
